package cn.itcast.p2p20.act;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;

public class BaseActivity extends AppCompatActivity {

    private MyApplication mApplication;

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
    }

    @Override
    public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
        super.onSaveInstanceState(outState, outPersistentState);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mApplication = ((MyApplication) getApplication());
        mApplication.addActivityToStack(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mApplication.removeActivityFromStack(this);
    }
}
